{{****************************************************************************}}
{{* CNAM directory plugin template                                           *}}
{{* Author   : Benoit Frigon                                                 *}}
{{* Last mod : 7 oct 2012                                                    *}}
{{*                                                                          *}}
{{*                                                                          *}}
{{****************************************************************************}}

<div style="display: none" id="dialog_cnam_delete" title="Delete CNAM entries?">
	<p><span class="ui-icon ui-icon-alert" style="float: left; margin: 0 7px 20px 0;"></span>
	These items will be permanently deleted and cannot be recovered. Are you sure?</p>
	<span style="display: none" id="dialog_cnam_delete_yes">Delete selected items</span>
    <span style="display: none" id="dialog_cnam_delete_cancel">Cancel</span>
</div>

<form id="cnam_frm_filters" action="" method="get">
	<input type="hidden" name="path" value="{{$tab_path}}" />

	<div class="box toolbar">
		<ul id="toolbar_cnam_test">
			<li class="text">Find :</li>
			<li><input name="s" type="text" id="cnam_txtsearch" style="width: 150px;" value="{{$s_query}}" /></li>
			<li><button class="icon-only" type="submit" name="action" value="search" title="Search"><img alt="Search" src="images/blank.png" class="icon16 icon16-search" /></button></li>	
			<li><a class="icon-only" tabindex="1" title="Clear search results" href="?path=CNAM.tools.cnam"><img alt="clear" src="images/blank.png" class="icon16 icon16-clear" /></a></li>
			
			<li class="separator">&nbsp;</li>
			<li class="dropdown" id="select"><a class="icon-only" tabindex="1" href="#"><img alt="Select" src="images/blank.png" class="icon16-unchecked" /></a>
				<img class="close-dropdown" src="images/blank.png" alt="" />
				<ul>
					<li><a tabindex="1" href="?path=CNAM.tools.cnam&action=select_all&page={{$page}}&s={{$s_query}}">All</a></li>
					<li><a tabindex="1" href="?path=CNAM.tools.cnam&page={{$page}}&s={{$s_query}}">None</a></li>
				</ul>
			</li>
			
			<li><a title="Add new item" href="?path=CNAM.tools.cnam&action=add"><img src="images/blank.png" class="icon16 icon16-add" />New</a></li>
			<li id="delete"><button type="submit" name="action" value="delete" title="Delete selected item(s)"><!--delete--><img src="images/blank.png" class="icon16-delete" />Delete</button></li>
			
			<li class="separator">&nbsp;</li>
			<li class="{{is|"$page<=1"|disabled}}" title="First page" id="first_page"><a tabindex="1" href="?path=CNAM.tools.cnam&page=1&{{$uri_query}}"><img alt="First page" src="images/blank.png" class="icon16 icon16-first" /></a></li>
			<li class="{{is|"$page<=1"|disabled}}" title="Previous page" id="prev_page"><a tabindex="1" href="?path=CNAM.tools.cnam&page={{$prev_page}}&{{$uri_query}}"><img alt="Prev. page" src="images/blank.png" class="icon16 icon16-prev" /></a></li>
			<li class="dropdown" id="page" style=""><a tabindex="1" title="Page {{$page}} of {{$last_page}}" href="#">Page {{$page}}</a>
				<img class="close-dropdown" src="images/blank.png" alt="" />
				<ul>
				{{foreach|$pages}}
					<li><a tabindex="1" href="?path=CNAM.tools.cnam&page={{row}}&s={{$s_query}}">Page {{row}}</a></li>
				{{/foreach}}
				</ul>
			</li>
			<li class="{{is|"$page>=$last_page"|disabled}}" title="Next page" id="next_page"><a tabindex="1" href="?path=CNAM.tools.cnam&page={{$next_page}}&{{$uri_query}}"><img alt="Next page" src="images/blank.png" class="icon16 icon16-next" /></a></li>
			<li class="{{is|"$page>=$last_page"|disabled}}" title="Last page" id="last_page"><a tabindex="1" href="?path=CNAM.tools.cnam&page={{$last_page}}&{{$uri_query}}"><img alt="Last page" src="images/blank.png" class="icon16 icon16-last" /></a></li>

		</ul>
	
		<div class="clear"></div>
	</div>

	<table id="cnam" class="grid">
		<tr>
			<th class="column-icon">&nbsp;</th>
			<th style="width: 170px" >Number</th>
			<th style="width: 200px">Caller ID (CNAM)</th>
			<th style="width: 230px">Full name</th>
			<th class="column-actions"></th>
		</tr>
		{{resultset|$results}}
			<tr class="{{altern|cnam|alt}} highlight">
				<td class="column-icon"><input type="checkbox" name="id[]" value="{{column|id}}" {{is|"$action==select_all"|checked}} /></td>
				<td class="clickable"><a tabindex="1" href="?path=CNAM.tools.cnam&action=edit&id={{column|id}}">{{column|number|format_phone}}</a></td>
				<td class="clickable"><a tabindex="1" href="?path=CNAM.tools.cnam&action=edit&id={{column|id}}">{{column|cidname}}</a></td>
				<td class="clickable"><a tabindex="1" href="?path=CNAM.tools.cnam&action=edit&id={{column|id}}">{{column|fullname}}</a></td>
				<td class="column-actions">
					<a tabindex="1" href="?path=CNAM.tools.cnam&action=edit&id={{column|id}}"><img alt="Edit" class="icon16 icon16-edit" src="images/blank.png" /></a>
					<a tabindex="1" href="?path=CNAM.tools.cnam&action=delete&id[]={{column|id}}"><img alt="Delete" class="icon16 icon16-delete" src="images/blank.png" /></a>
				</td>
			</tr>
		{{/resultset}}
	</table>
</form>
<p class="v_spacing">{{$num_results}} result(s) found. (Page {{$page}} of {{$last_page}})</p>
